#pragma once
#include "common.h"
#include <vector>
using namespace std;
#include "../dldmsg/globle.h"
#include "../dldmsg/msg2.h"

enum PlayerState
{
	psInRoom	= 0x01,
	psOnTable	= 0x02,
	psReady		= 0x04,
	psPlaying	= 0x08,
	psTaoPao	= 0x10,
	psCut		= 0x20
};

class CPlayer
{
public:
	//int		m_UserID;
	//char	m_NickName[USER_NAME_LEN];
	//int		m_GameCounts;
	//int		m_WinCounts;
	//int		m_RunAwayCounts;
	//int		m_TableID;
	//int		m_TableStation;
	//int		m_flag;

	sUserDataGame m_userData;

	CPlayer()
	{

	}
	CPlayer(sUserDataGame *data)
	{
		memcpy(this,data,sizeof(sUserDataGame));
	}

public:
	bool	HasFlag(int flag)
	{
		return (m_userData.flag & flag) == flag;
	}

	void	AddFlag(int flag)
	{
		m_userData.flag |= flag;
	}

	void	SubFlag(int flag)
	{
		m_userData.flag ^= flag;
	}
};

typedef vector<CPlayer*> VPlayer;
typedef VPlayer::iterator VPlayerIt;